<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<head th:include="include :: bootstrap-duallistbox-css"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-contestProblem-add">
		<input id="contestId" name="contestId"th:value="${contestId}"  type="hidden">
		<select class="form-control dual_select" multiple>
		
		</select>
			<div class="form-group">
			<label class="col-sm-3 control-label">题目编号：</label>
			<div class="col-sm-8">
				<input id="problemId" name="problemId" class="form-control" type="text">
			</div>
		</div>
	
			<div class="form-group">
			<label class="col-sm-3 control-label">赛事编号：</label>
			<div class="col-sm-8">
				<input id="contestId" name="contestId" class="form-control" type="text">
			</div>
		</div>
	
			<div class="form-group">
			<label class="col-sm-3 control-label">题目名称：</label>
			<div class="col-sm-8">
				<input id="title" name="title" class="form-control" type="text">
			</div>
		</div>
	
			<div class="form-group">
			<label class="col-sm-3 control-label">题目序号ABC：</label>
			<div class="col-sm-8">
				<input id="num" name="num" class="form-control" type="text">
			</div>
		</div>
	

	
	</form>
</div>
<div th:include="include::footer"></div>
<div th:include="include::bootstrap-duallistbox-js"></div>
<script type="text/javascript">
	var prefix = ctx + "acm/contestProblem";
	

    	
    	//$('.dual_select').val()
$(function() {
/* var addcp=$('.dual_select').bootstrapDualListbox({
	    	nonSelectedListLabel: '未有题目',
            selectedListLabel: '已有题目',
            preserveSelectionOnMove: 'moved',
            moveOnSelect: false,           // 出现一个剪头，表示可以一次选择一个
            filterTextClear: '展示所有',
            moveSelectedLabel: "添加",
            moveAllLabel: '添加所有',
            removeSelectedLabel: "移除",
            removeAllLabel: '移除所有',
            infoText: '共{0}个',
            showFilterInputs: false,       // 是否带搜索
	        selectorMinimalHeight: 160
	    }); */
  var requestUrl = ctx + "acm/problem/list2";
  var reqeustParams = "";//有参数用json格式
  var selectElement = ".dual_select";
  var selectedDataStr = "";//选中的option（用过英文逗号隔开；新增时，无选中option）
  //初始化duallistbox
  initListBox(requestUrl, reqeustParams, selectElement, 'problemId', 'title', selectedDataStr,true);
  //addcp.bootstrapDualListbox('refresh', true);
});
    
	$("#form-contestProblem-add").validate({
		onkeyup: false,
		rules:{
			xxxx:{
				required:true,
			},
		}
	});

	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save(prefix + "/addDo", $('#form-contestProblem-add').serialize());
		}
	}
</script>
</body>
</html>
